home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / RAND / ALL95.LZH / transcript_1108 / text0003.txt < prev    next >
Encoding:
Text File  |  1995-11-26  |  2.2 KB  |  54 lines

  1. > Actually, the speed seems only a little improved, but I've started to
  2.  
  3. I was afraid of that.
  4.  
  5. > optimise the code only this week end, I'll continue to optimise it now ...
  6.  
  7. I hope you find a lot of improvements to make.
  8.  
  9. > Could you send me the sector height check function, I'll implement it..
  10.  
  11. I'll send it at the same time as the map drawing code. I doubt it's really
  12. a good idea to implement the current version, though. It's not very smart
  13. at all. On the other hand it mostly uses code you've already written so it
  14. shouldn't take you long.
  15.  
  16. By the way, does anyone have an idea for a good algorithm for the following:
  17. + We have an (x,y) position and a movement vector (or second position).
  18. + We have a lot of convex polygons.
  19. Now:
  20. - Find the polygon that contains the first position.
  21.   (You can assume this is known.)
  22. - Find out which side of the polygon is crossed by the line (x,y) ->
  23.   (x+dx,y+dy), if any.
  24. - Find out where on the polygon side the movement vector intersects it.
  25. - Force the movement to be contained within the original polygon by 'sliding'
  26.   along the sides.
  27.  
  28. It is of course possible to do some checks using the line equations, but
  29. that takes divides and such which isn't very nice. Perhaps it's the only
  30. way, but I sure hope not.
  31.  
  32. > No, I've still got them. When I say correctly displaying, I mean that until
  33. > last week, my walls were very strange : they were displayed everywhere... :)
  34.  
  35. ;-)
  36.  
  37. > What do you call the Direct drawing ? Do you mean with your method ?
  38.  
  39. Yes, drawing the walls and floors/ceiling as soon as you know how rather
  40. than waiting until they're all known. I believe that's the best way to do
  41. it even if we have to keep all the clipping arrays.
  42.  
  43. I had a new idea about a fix for the clipping errors a couple of days ago,
  44. but it probably works just as well the ones I've had before...
  45. Perhaps some of our new participants on the list would like to have a go
  46. at it? A fresh look at the problem might solve it in a few minutes.
  47.  
  48. -- 
  49.   Chalmers University   | Why are these |  e-mail:   d8klojo@dtek.chalmers.se
  50.      of Technology      |  .signatures  |            rand@cd.chalmers.se
  51.                         | so hard to do |  www/ftp:  rand.thn.htu.se
  52.    Gothenburg, Sweden   |     well?     |            (MGIFv5 and QLem)
  53.  
  54.